var counterText = 0;
var counterRadioButton = 0;
var counterCheckBox = 0;
var counterTextArea = 0;
function addAllInputs(divName, inputType){
	
     var newdiv = document.createElement('span');
     switch(inputType) {
          case 'text':
               newdiv.innerHTML = "<p class='editable_textarea' id='paragraph_"+(counterText + 1)+"'>Click here to add label.</p><br><input type='text' name='myInputs[]' /><input type='button' name='remove' class='remove' value='Remove' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>";
               counterText++;               
               break;
          case 'radio':        	   
               newdiv.innerHTML = "<p class='editable_textarea' id='paragraph_"+(counterRadioButton + 1)+"'>Click here to add label.</p><br><input type='radio' name='myRadioButtons[]' /><input type='button' name='remove' class='remove' value='Remove' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>";
               counterRadioButton++;
               break;
          case 'checkbox':
               newdiv.innerHTML = "<p class='editable_textarea' id='paragraph_"+(counterCheckBox + 1)+"'>Click here to add label.</p><br><input type='checkbox' name='myCheckBoxes[]' /><input type='button' name='remove' class='remove' value='Remove' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>";
               counterCheckBox++;
               break;
          case 'textarea':
	       newdiv.innerHTML = "<p class='editable_textarea' id='paragraph_"+(counterTextArea + 1)+"'>Click here to add label.</p><br><textarea name='myTextAreas[]'>type here...</textarea><input type='button' name='remove' class='remove' value='Remove' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>";
               counterTextArea++;
               break;
          }
     document.getElementById(divName).appendChild(newdiv);
     //alert($(".editable_textarea").html());
     $(".editable_textarea").editable("index.php", { 
	      indicator : "<img src='img/indicator.gif'>",
	      type   : 'textarea',
	      submitdata: { _method: "put" },
	      select : true,
	      submit : 'OK',
	      cancel : 'cancel',
	      cssclass : "editable",
	      autogrow : {
	          lineHeight : 16,
	          minHeight  : 32
	       }
	  });
}